home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / g_man / cat3 / OpenGL / hyperpipe.z / hyperpipe
Encoding:
Text File  |  1998-10-30  |  8.7 KB  |  224 lines

  1. NNNNAAAAMMMMEEEE
  2. GGGGLLLLXXXX____SSSSGGGGIIIIXXXX____hhhhyyyyppppeeeerrrrppppiiiippppeeee - hyperpipe extension
  3.  
  4. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  5.     Even though graphics hardware is constantly improving in speed, there
  6.     will always be applications that require more performance than is
  7.     available from a single pipeline. In order to overcome these limits,
  8.     it is possible to parallelize the rendering task across multiple
  9.     pipes; the image outputs of these pipes must then be assembled into
  10.     a single display output. This group of pipes is termed a hyperpipe;
  11.     the pipes involved must be physically cabled together in some way
  12.     to form a hyperpipe network. Typically a hyperpipe network uses one
  13.     of the pipes to assemble the rendered images and drive the display.
  14.  
  15.     In a hyperpipe network, the rendering task may be divided by rendering
  16.     each successive frame on a different hardware pipe (temporal division);
  17.     by dividing the frame into rectangular subregions and rendering each
  18.     on a different pipe (spatial division); or by a combination of these
  19.     two techniques. Specific hardware implementations may impose limits
  20.     on how rendering may be subdivided; but in general it is possible to
  21.     use a subset of the pipes connected to a hyperpipe network if desired.
  22.  
  23.     This extension provides a means for configuring and managing a group
  24.     of rendering pipes which work together to produce a single display.
  25.     Typically, a hyperpipe application will be multi threaded, with
  26.     one thread per pipe; each thread needs to create its own rendering
  27.     context. The hyperpipe extension allows these rendering threads to
  28.     communicate with the hardware.
  29.  
  30.     The API calls allow an application to :
  31.  
  32.     o  Determine the physical configuration of a hyperpipe network.
  33.  
  34.     o  Configure the hyperpipe. The hyperpipe configuration used by the
  35.        application may be a subset of the physical hyperpipe network.
  36.        The rendering task may be divided in time slices (temporally divided),
  37.        in rectangular regions of a single frame (spatially divided), or both.
  38.        The hyperpipe configuration is subject to hardware constraints.
  39.  
  40.        For example, on a hyperpipe network consisting of five pipes, it
  41.        would be possible to configure a rendering task in two time slices,
  42.        with each slice being rendered by two pipes; thus using four total
  43.        pipes. (The fifth pipe would not be used in the hyperpipe, and
  44.        could be used for normal non-hyperpipe rendering and display).
  45.  
  46.     o  Maintain state to manage the glXSwapBuffers  call correctly. In
  47.        spatial subdivision, swap cannot occur until all pipes rendering
  48.        the next frame have completed; and in temporal subdivision, swap
  49.        cannot occur until the appropriate time. Swap management is
  50.        handled by the displaying pipe.
  51.  
  52.     o  Redirect resize parameters correctly; typically resize is handled
  53.        by the displaying pipe, and must be managed synchronously with
  54.        swap.
  55.  
  56.     o  Balance load among the pipes in the spatial subdivision case.
  57.  
  58.     o  Clean up operations when a hyperpipe application terminates
  59.        (either normally or due to error).
  60.  
  61.     This extension adds to the set of conditions that must be met before
  62.         a buffer swap can take place.
  63.  
  64.  
  65.  
  66.  
  67. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  68. The main functions are
  69.  
  70. ggggllllXXXXQQQQuuuueeeerrrryyyyHHHHyyyyppppeeeerrrrppppiiiippppeeeeNNNNeeeettttwwwwoooorrrrkkkkSSSSGGGGIIIIXXXX queries the physical hyperpipe network.
  71.  
  72. ggggllllXXXXHHHHyyyyppppeeeerrrrppppiiiippppeeeeCCCCoooonnnnffffiiiiggggSSSSGGGGIIIIXXXX configure the hyperpipe network.
  73.  
  74. ggggllllXXXXQQQQuuuueeeerrrryyyyHHHHyyyyppppeeeerrrrppppiiiippppeeeeCCCCoooonnnnffffiiiiggggSSSSGGGGIIIIXXXX query a particular hyperpipe configuration.
  75.  
  76. ggggllllXXXXDDDDeeeessssttttrrrrooooyyyyHHHHyyyyppppeeeerrrrppppiiiippppeeeeCCCCoooonnnnffffiiiiggggSSSSGGGGIIIIXXXX destroy a hyperpipe configuration.
  77.  
  78. ggggllllXXXXBBBBiiiinnnnddddHHHHyyyyppppeeeerrrrppppiiiippppeeeeSSSSGGGGIIIIXXXX bind a process and rendering context to a hyperpipe
  79. configuration.
  80.  
  81.  
  82. NNNNOOOOTTTTEEEESSSS
  83. In case of hyperpipes, it is valid to call ggggllllXXXXSSSSwwwwaaaappppBBBBuuuuffffffffeeeerrrrssss on a single buffered
  84. visual. In addition to its usual functionality, calling ggggllllXXXXSSSSwwwwaaaappppBBBBuuuuffffffffeeeerrrrssss
  85.  on a rendering context bound to a hyperpipe, causes the hyperpipe to switch
  86. to the next pipe.
  87.  
  88. In the case of hyperpipes, the hyperpipe id associated with a context can be
  89. determined by calling ggggllllXXXXQQQQuuuueeeerrrryyyyCCCCoooonnnntttteeeexxxxttttIIIInnnnffffooooEEEEXXXXTTTT with an attribute of
  90. GGGGLLLLXXXX____HHHHYYYYPPPPEEEERRRRPPPPIIIIPPPPEEEE____IIIIDDDD____SSSSGGGGIIIIXXXX.
  91.  
  92. SSSSAAAAMMMMPPPPLLLLEEEE CCCCOOOODDDDEEEE
  93.      Typically a hyperpipe application will have a master process which
  94.  
  95.      o Queries the hyperpipe network.
  96.  
  97.      o Chooses a subset of the pipes on the hyperpipe network.
  98.  
  99.      o Sets up a hyperpipe configuration using the above pipes.
  100.  
  101.      o Forks off as many processes as required to manage these pipes.
  102.  
  103.      o Each child process creates its own window and a direct context.
  104.  
  105.      o Each child process then binds its current, direct rendering
  106.        context to the hyperpipe id supplied by the master process.
  107.  
  108.  
  109.  
  110.      Master Process
  111.  
  112.              GLXHyperpipeNetworkSGIX * nw;
  113.              GLXHyperpipeConfigSGIX cfg[32];
  114.              char * extString;
  115.  
  116.  
  117.  
  118.              /* Open the default display */
  119.              dpy = XOpenDisplay( 0 );
  120.  
  121.              scr = DefaultScreen( dpy );
  122.  
  123.              /* Query the extension string to verify that the
  124.              ** hyperpipe extension is present
  125.              */
  126.  
  127.              extString = (char *)glXQueryExtensionsString(dpy,scr);
  128.  
  129.              if (!strstr( extString, "GLX_SGIX_hyperpipe")) {
  130.                      /* Abort */
  131.  
  132.  
  133.              }
  134.  
  135.              /* Query the hyperpipe network */
  136.  
  137.              nw  = glXQueryHyperpipeNetworkSGIX(dpy, &npipes);
  138.              if ( (nw== NULL) || (npipes == 0 ) ) {
  139.  
  140.                      /* No hyperpipe network, Abort */
  141.  
  142.              }
  143.  
  144.              /* Choose some pipes from the above list in nw and fill in the
  145.              ** configuration structure
  146.              ** The sample code below sets up a 3 pipe hyperpipe
  147.              */
  148.  
  149.              nid = nw[0].networkId;
  150.              npipes = 2;
  151.  
  152.              for (i=0; i<npipes; i++) {
  153.  
  154.                      strcpy (cfg[i].pipeName, nw[i].pipeName);
  155.                      cfg[i].participationType = GLX_HYPERPIPE_RENDER_PIPE_SGIX;
  156.                      cfg[i].timeSlice = i;
  157.                      cfg[i].channel = 0;
  158.  
  159.              }
  160.  
  161.              /* Choose the first pipe to be the display pipe also */
  162.  
  163.              cfg[0].participationType |=  GLX_HYPERPIPE_DISPLAY_PIPE_SGIX;
  164.  
  165.              if (glXHyperpipeConfigSGIX( dpy,
  166.                      nw[0].networkId,
  167.                      npipes,
  168.                      cfg,
  169.                      &hpId)
  170.                      == GLX_BAD_HYPERPIPE_CONFIG_SGIX) {
  171.  
  172.                      /*Something wrong with the hyperpipe configuration;Abort */
  173.  
  174.              }
  175.  
  176.              /* Don't need the hyperpipe network information any more */
  177.  
  178.              XFree (nw);
  179.  
  180.              /*Now fork npipes number of process */
  181.  
  182.              /* hang around untill all child processes finish */
  183.              glXDestroyHyperpipeConfigSGIX(dpy, hpId);
  184.  
  185.  
  186.  
  187.      Each child process then calls :
  188.  
  189.              /* Open Display and screen */
  190.  
  191.  
  192.              /* sanity checking to ensure that the hyperpipe
  193.              ** is present on the required pipes
  194.              */
  195.  
  196.              extString = (char *)glXQueryExtensionsString(dpy,scr);
  197.              if (!strstr( extString, "GLX_SGIX_hyperpipe")) {
  198.  
  199.                      /* Abort */
  200.  
  201.              }
  202.  
  203.  
  204.              /* Create a direct rendering context and make it current */
  205.  
  206.              if (glXBindHyperpipeSGIX (dpy, hpId) {
  207.  
  208.                      /* Error in bind; Abort */
  209.  
  210.              }
  211.  
  212.              /* Render */
  213.  
  214.              glXSwapBuffers(...);
  215.  
  216.  
  217.              /* All done */
  218.  
  219.              glXBindHyperpipeSGIX(dpy, -1);
  220.  
  221.  
  222.  
  223.  
  224.